package abc.ynny.domo05;

public class Student extends Person{
    String no;
    int scoreEnglish;
    int scoreMath;
    int scoreChinese;


    public double aver(){
        return (scoreEnglish + scoreMath + scoreChinese)/3;
    }
    public double max(){
        return Math.max(Math.max(scoreEnglish, scoreMath), scoreChinese);
    }
    public double min(){
        return Math.min(Math.min(scoreEnglish, scoreMath), scoreChinese);
    }
    public double sum(
    ){
        return scoreEnglish + scoreMath + scoreChinese;
    }
    @Override
    public String toString() {
        return "Student{" +
                "姓名='" + getName() + '\'' +
                ", 性别='" + getSex() + '\'' +
                ", 年龄=" + getAge() +
                "学号 ='" + no + '\'' +
                ", 英语成绩 =" + scoreEnglish +
                ", 数学成绩 =" + scoreMath +
                ", 语文成绩 =" + scoreChinese +
                ", 平均成绩 =" + aver() +
                ", 最高分 =" + max() +
                ", 最低分 =" + min() +
                ", 总分 =" + sum() +
                '}';
    }
}
